<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="js/jquery-1.12.2.min.js" ></script>
	</head>
	<body>
		
		<table border="1" width="200">
			<tr>
				<td>name</td>
				<td>age</td>
			</tr>
			
		</table>
		
		
		<script>
			// 把数组中的数据添加到表格里面
			var arr =  [{name:"zhangsan", age:"20"},
			            {name:"lisi", age:"12"},
			            {name:"liuer", age:"18"}
			           ];
			
			// 循环遍历
			$(arr).each(function() {
		      // 拼接要输出的html
			  var html = "<tr><td>" + this.name + "</td><td>" + this.age+ "</td></tr>" ;
			  // 添加新创建的dom对象
			  $("table").append($(html));
			
			});
			
		</script>
		
		
	</body>
</html>
